Skip to content

Sign in with named profiles, one account each - #164

Merged
robertlemke merged 1 commit into
mainfrom
task/named-profiles
Nov 22, 2026
Merged

robertlemke merged 1 commit into
mainfrom
task/named-profiles

Conversation

@robertlemke

Copy link
Copy Markdown
Member

The CLI now keeps named profiles instead of hosts, so you can switch between organizations without typing the full address: --profile flownative, --profile familie. A profile bundles a host, a token and the account they sign in as. Several profiles may point to the same host, for example two accounts in one organization.

Choosing a profile, strongest first: --profile, then --host (both together are a usage error); then $MINKA_PROFILE, then $MINKA_HOST; then the default profile. A host that several profiles point to takes the default profile if it is one of them, and otherwise stops with exit 8, naming the profiles. $MINKA_HOST with $MINKA_TOKEN and no config file works as before. When a profile wins over a set $MINKA_TOKEN, a notice says the token was not used.

Commands

  • auth login [--profile <name>] creates a profile or signs an existing one in again. Without --profile it behaves as before, and the first profile becomes the default.
  • profiles list, profiles rename, profiles remove [--revoke] and profiles default.
  • auth logout removes the active profile. config set host makes the profile on that host the default.
  • auth status and doctor name the active profile; auth status also says where the choice came from. The JSON fields are added, not renamed.

Existing configurations need nothing done: every host becomes a profile named after the host, and the default host becomes the default profile. A plain read never rewrites the file. A save writes profiles and also mirrors hosts/defaultHost, so older minka versions keep reading the file. The work store, with the lists behind the heartbeat, is kept per profile and mirrored the same way.

For the release notes: an older version that writes the file keeps every sign-in, but loses the profile names and any second account on the same host.

Register: C-191 to C-196, with C-044 and C-179 to C-181 rewritten for profiles; the rules are in docs/stable/profiles.md. Checked against the fake and with a built binary on temporary config files only, not live yet. An independent review ran over several rounds, with every finding fixed, among them a sign-out by host that took the wrong profile on a shared host. Each safeguard has a test and a sabotage proof.

Resolves: https://minka.flownative.com/go/card/MNK-TP

The CLI now keeps profiles instead of hosts: a profile has a name of its
own and bundles a host, a token and the account it acted as. A command
picks one with --profile or $MINKA_PROFILE, or by host with --host or
$MINKA_HOST, else it uses the default profile. "profiles list",
"rename", "remove" and "default" manage them, and "auth status" and
"doctor" name the active profile and where the choice came from.

Previously, the configuration held one token per host. Switching
between organizations meant typing the full address, and two accounts
on one host could not exist side by side. A host still works as a way
to choose: it stands for its one profile, or for the default among
several, and refuses to guess otherwise. A sign-out by host follows
the same rule, so it never removes or revokes one of two accounts by
chance. $MINKA_TOKEN keeps going only to $MINKA_HOST and never to a
named profile, which may be another account on the same host; a notice
says when it was passed over.

An existing file is taken over on load: every host becomes a profile
named after it, and the default host the default profile. A plain read
never rewrites it. When this version saves, it writes the hosts and the
default host beside the profiles, so an older minka still signs in.
An older minka that writes the file drops the profiles, though. The
next read then takes its hosts over again, so no sign-in is lost, but
the profile names and any second account on a host are.

The cards of "work start" are kept per account now, so two accounts on
one host do not report each other's cards. A store kept per host goes to
the profile its host stands for, and the store keeps per host the lists
of that profile beside the accounts, for an older minka. Removing a
profile drops its lists, so that a later profile of the same name on
another host never reports them with its token. Lists that a failed move
or drop leaves under a name no profile has are passed over, and a new
profile clears its name in the store before it is saved. Nothing deletes
them merely because the configuration lacks the name, since a command
may read the configuration in the middle of a rename. The heartbeat runs
from the mod with the environment Claude Code was started with, so it
reports every account that holds a list of its session, each with its
own token, rather than only the default one. The read marks of comments
and the positions of notifications were already kept per token and stay
as they are.

Resolves: https://minka.flownative.com/go/card/MNK-TP
@robertlemke
robertlemke merged commit 16d4979 into main Nov 22, 2026
2 checks passed
@robertlemke
robertlemke deleted the task/named-profiles branch November 22, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant